<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="纪德朝">
    <title>分期效果</title>
    <style>
        div {
            width: 500px;
            margin: 0 auto;
        }

        ul,
        li {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        a {
            text-decoration: none;
            color: inherit;
            font-size: inherit;
        }

        ul {
            display: flex;
        }

        ul>li {
            width: 100px;
            padding: 0 10px;
            margin: 0 5px;
            height: 30px;
            line-height: 30px;
            background-color: white;
            color: black;
            border: 1px solid lightslategray;
            position: relative;
        }

        .active {
            position: absolute;
            top: 30px;
            left: -6px;
            display: none;
        }

        .active li {
            width: 300px;
            background-color: lightgoldenrodyellow;
            border: 1px solid lightslategray;
        }

        .button {
            font-size: 30px;
            background-color: green;
            border: none;
            display: none;
        }

        .color {
            border: 1px solid red;
        }
    </style>
</head>

<body>
    <div>
        <ul>
            <li class="color">
                <a href="#">不分期</a>
                <ul class="active">
                    <li>无手续费</li>
                </ul>
            </li>
            <li>
                <a href="#">￥*3期</a>
                <ul class="active">
                    <li>含手续费：费率0.5%，￥24×3期</li>
                </ul>
            </li>
            <li>
                <a href="#">￥*6期</a>
                <ul class="active">
                    <li>含手续费：费率0.5%，￥24×3期</li>
                </ul>
            </li>
            <li>
                <a href="#">￥*12期</a>
                <ul class="active">
                    <li>含手续费：费率0.5%，￥24×3期</li>
                </ul>
            </li>
            <li>
                <a href="#">￥*24期</a>
                <ul class="active">
                    <li>含手续费：费率0.5%，￥24×3期</li>
                </ul>
            </li>
        </ul>
    </div>
    <button type="button" class="button">打白条</button>
    <script src="./js/jquery.js"></script>
</body>
<script>
    $('div>ul>li').hover(function () {
        $(this).css('border', '1px solid red');
        $(this).find('.active').show();
    }, function () {
        $(this).css('border', '');
        $(this).find('.active').hide();
    });
    var count = 0;
    $('div>ul>li').click(function (ev) {
        $(this).toggleClass('color').siblings().removeClass('color');
        if ($(this).hasClass('color')) {
            $('button').removeClass('button');
        } else {
            $('button').addClass('button');
        }
    });

</script>

</html>